package com.mqz.seal.v1.prs.reponsitory;

import com.mqz.seal.v1.prs.model.SealDTO;

import java.awt.*;
import java.awt.font.FontRenderContext;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.awt.image.ImageObserver;

/**
 * 
 *
 * @类描述：正 方 形
 *
 *
 * @创建时间：2021年8月18日 下午4:57:03
 *
 *
 */

public class ZFXRepository {

    public static final int INIT_BEGIN = 10;


    public static BufferedImage drawThreeFont(BufferedImage bi, Graphics2D g2d, SealDTO font, int lineSize, int imageSize, int fixH, int fixW, Color color) {
        fixH += 10;
        int marginW = fixW + lineSize;
        Font f = new Font(font.getFontFamily(), 1, 120);
        g2d.setFont(f);
        FontRenderContext context = g2d.getFontRenderContext();
        Rectangle2D rectangle = f.getStringBounds(font.getFontContent().substring(0, 1), context);
        float marginH = (float)(Math.abs(rectangle.getCenterY()) * 2.0D + (double)marginW) + (float)fixH;
        int oldW = marginW;
        BufferedImage nbi = new BufferedImage(imageSize, imageSize, bi.getType());
        Graphics2D ng2d = nbi.createGraphics();
        ng2d.setPaint(color);
        ng2d.drawImage(bi, 0, 0, imageSize, imageSize, (ImageObserver)null);
        ng2d.setStroke(new BasicStroke((float)lineSize));
        ng2d.drawRect(0, 0, imageSize, imageSize);
        ng2d.dispose();
        g2d = nbi.createGraphics();
        g2d.setPaint(color);
        g2d.setFont(f);
        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        g2d.drawString(font.getFontContent().substring(2, 3), (float)marginW, marginH);
        marginW = (int)((double)marginW + Math.abs(rectangle.getCenterX()) * 2.0D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
        g2d.drawString(font.getFontContent().substring(0, 1), (float)marginW, marginH);
        marginH = (float)((double)marginH + Math.abs(rectangle.getHeight()));
        g2d.drawString(font.getFontContent().substring(3, 4), (float)oldW, marginH);
        g2d.drawString(font.getFontContent().substring(1, 2), (float)marginW, marginH);
        return nbi;
    }

    public static BufferedImage drawFourFont(BufferedImage bi, SealDTO font, int lineSize, int imageSize, int fixH, int fixW, Color color) {
        fixH += 10;
        int marginW = fixW + lineSize;
        BufferedImage nbi = new BufferedImage(imageSize, imageSize, bi.getType());
        Graphics2D ng2d = nbi.createGraphics();
        ng2d.setPaint(color);
        ng2d.drawImage(bi, 0, 0, imageSize, imageSize, (ImageObserver)null);
        ng2d.setStroke(new BasicStroke((float)lineSize));
        ng2d.drawRect(0, 0, imageSize, imageSize);
        ng2d.dispose();
        Graphics2D g2d = nbi.createGraphics();
        g2d.setPaint(color);
        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        FontRenderContext context = g2d.getFontRenderContext();
        Font f = new Font(font.getFontFamily(), 1, font.getFontSize());
        System.out.println("字体......" + f.getName() + "....." + f.getFamily() + "....." + f.getFontName());
        g2d.setFont(f);
        Rectangle2D rectangle = f.getStringBounds(font.getFontContent().substring(0, 1), context);
        float marginH = (float)(Math.abs(rectangle.getCenterY()) * 2.0D + (double)marginW) + (float)fixH;
        g2d.drawString(font.getFontContent().substring(2, 3), (float)marginW, marginH);
        int oldW = marginW;
        marginW = (int)((double)marginW + Math.abs(rectangle.getCenterX()) * 2.0D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
        g2d.drawString(font.getFontContent().substring(0, 1), (float)marginW, marginH);
        marginH = (float)((double)marginH + Math.abs(rectangle.getHeight()));
        g2d.drawString(font.getFontContent().substring(3, 4), (float)oldW, marginH);
        g2d.drawString(font.getFontContent().substring(1, 2), (float)marginW, marginH);
        return nbi;
    }
    
    public static BufferedImage drawFiveFont(BufferedImage bi, SealDTO font, int lineSize, int imageSize, int fixH, int fixW, Color color) {
    	
    	 fixH += 10;
         int marginW = fixW + lineSize;
         int left = 16;
         BufferedImage nbi = new BufferedImage(imageSize, imageSize, bi.getType());
         Graphics2D ng2d = nbi.createGraphics();
         ng2d.setPaint(color);
         ng2d.drawImage(bi, 0, 0, imageSize, imageSize, (ImageObserver)null);
         ng2d.setStroke(new BasicStroke((float)lineSize));
         ng2d.drawRect(0, 0, imageSize, imageSize);
         ng2d.dispose();
         Graphics2D g2d = nbi.createGraphics();
         g2d.setPaint(color);
         g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
         FontRenderContext context = g2d.getFontRenderContext();
         Font f = new Font(font.getFontFamily(), 1, font.getFontSize());
        // System.out.println("字体......" + f.getName() + "....." + f.getFamily() + "....." + f.getFontName());
         g2d.setFont(f);
         
         System.out.println("===========================");
         System.out.println("font is : "+font.getFontContent());
         Rectangle2D rectangle = f.getStringBounds(font.getFontContent().substring(0, 1), context);
         float marginH = (float)(Math.abs(rectangle.getCenterY()) * 2.5D + (double)marginW) + (float)fixH-10;
        
         
         System.out.println("第1个字：x="+marginW +" ;y="+marginH);
         //g2d.drawString(font.getFontContent().substring(0, 1), (float)marginW, marginH);
         marginW=marginW+left;
         g2d.drawString(font.getFontContent().substring(0, 1), (float)marginW, marginH);
 		
         
         
         int oldW = marginW;
         int oldWInit = marginW;
         marginW = (int)((double)marginW + Math.abs(rectangle.getCenterX()) * 2.5D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
         System.out.println("第2个字：x="+marginW +" ;y="+marginH);
         g2d.drawString(font.getFontContent().substring(1, 2), (float)marginW, marginH);
         
         
         marginW = (int)((double)marginW + Math.abs(rectangle.getCenterX()) * 2.5D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
         System.out.println("第3个字：x="+marginW +" ;y="+marginH);
         g2d.drawString(font.getFontContent().substring(2, 3), (float)marginW, marginH);
         
       
         
         //第二行高度
         marginH = (float)((double)marginH + Math.abs(rectangle.getHeight()) * 1.0D);
         
         
         System.out.println("第5个字：x="+oldW +" ;y="+marginH);
         
         String line5 = font.getFontContent().substring(3, 4);
         g2d.drawString(line5, (float)oldW, marginH);
         
         oldW = (int)((double)oldW + Math.abs(rectangle.getCenterX()) * 2.5D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
        
         g2d.drawString(font.getFontContent().substring(4, 5), (float)oldW, marginH);
         
       
         
       
       
         
         
         //绘制编号
         Font fnew = new Font(font.getFontFamily(), 1, 26);
         g2d.setFont(fnew);
         
         marginH = (float)((double)marginH + Math.abs(rectangle.getHeight()) * 1.0D);
         oldW = (int)((double)oldW + Math.abs(rectangle.getCenterX()) * 2.0D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
         g2d.drawString(font.getNo(), (float)oldWInit, marginH);
 		
 		return nbi;
    }

	public static BufferedImage drawSixFont(BufferedImage bi, SealDTO font, int lineSize, int imageSize, int fixH,
			int fixW, Color color) {
		

		 fixH += 10;
        int marginW = fixW + lineSize;
        int left = 16;
        BufferedImage nbi = new BufferedImage(imageSize, imageSize, bi.getType());
        Graphics2D ng2d = nbi.createGraphics();
        ng2d.setPaint(color);
        ng2d.drawImage(bi, 0, 0, imageSize, imageSize, (ImageObserver)null);
        ng2d.setStroke(new BasicStroke((float)lineSize));
        ng2d.drawRect(0, 0, imageSize, imageSize);
        ng2d.dispose();
        Graphics2D g2d = nbi.createGraphics();
        g2d.setPaint(color);
        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        FontRenderContext context = g2d.getFontRenderContext();
        Font f = new Font(font.getFontFamily(), 1, font.getFontSize());
       // System.out.println("字体......" + f.getName() + "....." + f.getFamily() + "....." + f.getFontName());
        g2d.setFont(f);
        
        System.out.println("===========================");
        System.out.println("font is : "+font.getFontContent());
        Rectangle2D rectangle = f.getStringBounds(font.getFontContent().substring(0, 1), context);
        float marginH = (float)(Math.abs(rectangle.getCenterY()) * 2.5D + (double)marginW) + (float)fixH-10;
       
        
        System.out.println("第1个字：x="+marginW +" ;y="+marginH);
        //g2d.drawString(font.getFontContent().substring(0, 1), (float)marginW, marginH);
        marginW=marginW+left;
        g2d.drawString(font.getFontContent().substring(0, 1), (float)marginW, marginH);
		
        
        
        int oldW = marginW;
        int oldWInit = marginW;
        marginW = (int)((double)marginW + Math.abs(rectangle.getCenterX()) * 2.5D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
        System.out.println("第2个字：x="+marginW +" ;y="+marginH);
        g2d.drawString(font.getFontContent().substring(1, 2), (float)marginW, marginH);
        
        
        marginW = (int)((double)marginW + Math.abs(rectangle.getCenterX()) * 2.5D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
        System.out.println("第3个字：x="+marginW +" ;y="+marginH);
        g2d.drawString(font.getFontContent().substring(2, 3), (float)marginW, marginH);
        
      
        
        //第二行高度
        marginH = (float)((double)marginH + Math.abs(rectangle.getHeight()) * 1.0D);
        
        
        System.out.println("第5个字：x="+oldW +" ;y="+marginH);
        
        String line5 = font.getFontContent().substring(3, 4);
        g2d.drawString(line5, (float)oldW, marginH);
        
        oldW = (int)((double)oldW + Math.abs(rectangle.getCenterX()) * 2.5D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
       
        g2d.drawString(font.getFontContent().substring(4, 5), (float)oldW, marginH);
        
        oldW = (int)((double)oldW + Math.abs(rectangle.getCenterX()) * 2.5D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
        g2d.drawString(font.getFontContent().substring(5, 6), (float)oldW, marginH);
        
      
      
        
        
        //绘制编号
        Font fnew = new Font(font.getFontFamily(), 1, 26);
        g2d.setFont(fnew);
        
        marginH = (float)((double)marginH + Math.abs(rectangle.getHeight()) * 1.0D);
        oldW = (int)((double)oldW + Math.abs(rectangle.getCenterX()) * 2.0D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
        g2d.drawString(font.getNo(), (float)oldWInit, marginH);
		
		return nbi;
	}

	public static BufferedImage drawSevenFont(BufferedImage bi, SealDTO font, int lineSize, int imageSize, int fixH,
			int fixW, Color color) {
		
		 fixH += 10;
         int marginW = fixW + lineSize;
         int left = 16;
         BufferedImage nbi = new BufferedImage(imageSize, imageSize, bi.getType());
         Graphics2D ng2d = nbi.createGraphics();
         ng2d.setPaint(color);
         ng2d.drawImage(bi, 0, 0, imageSize, imageSize, (ImageObserver)null);
         ng2d.setStroke(new BasicStroke((float)lineSize));
         ng2d.drawRect(0, 0, imageSize, imageSize);
         ng2d.dispose();
         Graphics2D g2d = nbi.createGraphics();
         g2d.setPaint(color);
         g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
         FontRenderContext context = g2d.getFontRenderContext();
         Font f = new Font(font.getFontFamily(), 1, font.getFontSize());
        // System.out.println("字体......" + f.getName() + "....." + f.getFamily() + "....." + f.getFontName());
         g2d.setFont(f);
         
         System.out.println("===========================");
         System.out.println("font is : "+font.getFontContent());
         Rectangle2D rectangle = f.getStringBounds(font.getFontContent().substring(0, 1), context);
         float marginH = (float)(Math.abs(rectangle.getCenterY()) * 2.5D + (double)marginW) + (float)fixH-10;
        
         
         System.out.println("第1个字：x="+marginW +" ;y="+marginH);
         //g2d.drawString(font.getFontContent().substring(0, 1), (float)marginW, marginH);
         marginW=marginW+left;
         g2d.drawString(font.getFontContent().substring(0, 1), (float)marginW, marginH);
		
         
         
         int oldW = marginW;
         int oldWInit = marginW;
         marginW = (int)((double)marginW + Math.abs(rectangle.getCenterX()) * 1.5D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
         System.out.println("第2个字：x="+marginW +" ;y="+marginH);
         g2d.drawString(font.getFontContent().substring(1, 2), (float)marginW, marginH);
         
         
         marginW = (int)((double)marginW + Math.abs(rectangle.getCenterX()) * 1.5D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
         System.out.println("第3个字：x="+marginW +" ;y="+marginH);
         g2d.drawString(font.getFontContent().substring(2, 3), (float)marginW, marginH);
         
         marginW = (int)((double)marginW + Math.abs(rectangle.getCenterX()) * 1.5D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
         System.out.println("第4个字：x="+marginW +" ;y="+marginH);
         g2d.drawString(font.getFontContent().substring(3, 4), (float)marginW, marginH);
         
         //第二行高度
         marginH = (float)((double)marginH + Math.abs(rectangle.getHeight()) * 1.0D);
         
         
         System.out.println("第5个字：x="+oldW +" ;y="+marginH);
         
         String line5 = font.getFontContent().substring(4, 5);
         g2d.drawString(line5, (float)oldW, marginH);
         
         if(!line5.equals(".")) {
        	 oldW = (int)((double)oldW + Math.abs(rectangle.getCenterX()) * 1.5D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
         }else {
        	 oldW = (int)((double)oldW + Math.abs(rectangle.getCenterX()) * 0.8D);
         }
        
         g2d.drawString(font.getFontContent().substring(5, 6), (float)oldW, marginH);
         
         oldW = (int)((double)oldW + Math.abs(rectangle.getCenterX()) * 2.0D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
         g2d.drawString(font.getFontContent().substring(6, 7), (float)oldW, marginH);
         
       
       
         
         
         //绘制编号
         Font fnew = new Font(font.getFontFamily(), 1, 26);
         g2d.setFont(fnew);
         
         marginH = (float)((double)marginH + Math.abs(rectangle.getHeight()) * 1.0D);
         oldW = (int)((double)oldW + Math.abs(rectangle.getCenterX()) * 2.0D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
         g2d.drawString(font.getNo(), (float)oldWInit, marginH);
		
		return nbi;
		
	}

	public static BufferedImage drawEightFont(BufferedImage bi, SealDTO font, int lineSize, int imageSize, int fixH,
			int fixW, Color color) {
		
		
		 fixH += 10;
         int marginW = fixW + lineSize;
         int left = 16;
         BufferedImage nbi = new BufferedImage(imageSize, imageSize, bi.getType());
         Graphics2D ng2d = nbi.createGraphics();
         ng2d.setPaint(color);
         ng2d.drawImage(bi, 0, 0, imageSize, imageSize, (ImageObserver)null);
         ng2d.setStroke(new BasicStroke((float)lineSize));
         ng2d.drawRect(0, 0, imageSize, imageSize);
         ng2d.dispose();
         Graphics2D g2d = nbi.createGraphics();
         g2d.setPaint(color);
         g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
         FontRenderContext context = g2d.getFontRenderContext();
         Font f = new Font(font.getFontFamily(), 1, font.getFontSize());
        // System.out.println("字体......" + f.getName() + "....." + f.getFamily() + "....." + f.getFontName());
         g2d.setFont(f);
         
         System.out.println("===========================");
         System.out.println("font is : "+font.getFontContent());
         Rectangle2D rectangle = f.getStringBounds(font.getFontContent().substring(0, 1), context);
         float marginH = (float)(Math.abs(rectangle.getCenterY()) * 2.5D + (double)marginW) + (float)fixH-10;
        
         
         System.out.println("第1个字：x="+marginW +" ;y="+marginH);
         //g2d.drawString(font.getFontContent().substring(0, 1), (float)marginW, marginH);
         marginW=marginW+left;
         g2d.drawString(font.getFontContent().substring(0, 1), (float)marginW, marginH);
		
         
         
         int oldW = marginW;
         int oldWInit = marginW;
         marginW = (int)((double)marginW + Math.abs(rectangle.getCenterX()) * 1.5D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
         System.out.println("第2个字：x="+marginW +" ;y="+marginH);
         g2d.drawString(font.getFontContent().substring(1, 2), (float)marginW, marginH);
         
         
         marginW = (int)((double)marginW + Math.abs(rectangle.getCenterX()) * 1.5D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
         System.out.println("第3个字：x="+marginW +" ;y="+marginH);
         g2d.drawString(font.getFontContent().substring(2, 3), (float)marginW, marginH);
         
         marginW = (int)((double)marginW + Math.abs(rectangle.getCenterX()) * 1.5D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
         System.out.println("第4个字：x="+marginW +" ;y="+marginH);
         g2d.drawString(font.getFontContent().substring(3, 4), (float)marginW, marginH);
         
         //第二行高度
         marginH = (float)((double)marginH + Math.abs(rectangle.getHeight()) * 1.0D);
         
         
         System.out.println("第5个字：x="+oldW +" ;y="+marginH);
         
         String line5 = font.getFontContent().substring(4, 5);
         g2d.drawString(line5, (float)oldW, marginH);
         
         if(!line5.equals(".")) {
        	 oldW = (int)((double)oldW + Math.abs(rectangle.getCenterX()) * 1.5D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
         }else {
        	 oldW = (int)((double)oldW + Math.abs(rectangle.getCenterX()) * 0.8D);
         }
        
         g2d.drawString(font.getFontContent().substring(5, 6), (float)oldW, marginH);
         
         oldW = (int)((double)oldW + Math.abs(rectangle.getCenterX()) * 1.7D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
         g2d.drawString(font.getFontContent().substring(6, 7), (float)oldW, marginH);
         
         oldW = (int)((double)oldW + Math.abs(rectangle.getCenterX()) * 1.7D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
         g2d.drawString(font.getFontContent().substring(7, 8), (float)oldW, marginH);
       
         
         
         //绘制编号
         Font fnew = new Font(font.getFontFamily(), 1, 26);
         g2d.setFont(fnew);
         
         marginH = (float)((double)marginH + Math.abs(rectangle.getHeight()) * 1.0D);
         oldW = (int)((double)oldW + Math.abs(rectangle.getCenterX()) * 2.0D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
         g2d.drawString(font.getNo(), (float)oldWInit, marginH);
		
		return nbi;
	}

	public static BufferedImage drawNightFont(BufferedImage bi, SealDTO font, int lineSize, int imageSize, int fixH,
			int fixW, Color color) {
		
		
		 fixH += 10;
         int marginW = fixW + lineSize;
         int left = 16;
         BufferedImage nbi = new BufferedImage(imageSize, imageSize, bi.getType());
         Graphics2D ng2d = nbi.createGraphics();
         ng2d.setPaint(color);
         ng2d.drawImage(bi, 0, 0, imageSize, imageSize, (ImageObserver)null);
         ng2d.setStroke(new BasicStroke((float)lineSize));
         ng2d.drawRect(0, 0, imageSize, imageSize);
         ng2d.dispose();
         Graphics2D g2d = nbi.createGraphics();
         g2d.setPaint(color);
         g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
         FontRenderContext context = g2d.getFontRenderContext();
         Font f = new Font(font.getFontFamily(), 1, font.getFontSize());
        // System.out.println("字体......" + f.getName() + "....." + f.getFamily() + "....." + f.getFontName());
         g2d.setFont(f);
         
         System.out.println("===========================");
         System.out.println("font is : "+font.getFontContent());
         Rectangle2D rectangle = f.getStringBounds(font.getFontContent().substring(0, 1), context);
         float marginH = (float)(Math.abs(rectangle.getCenterY()) * 2.5D + (double)marginW) + (float)fixH-10;
        
         
         System.out.println("第1个字：x="+marginW +" ;y="+marginH);
         //g2d.drawString(font.getFontContent().substring(0, 1), (float)marginW, marginH);
         marginW=marginW+left;
         g2d.drawString(font.getFontContent().substring(0, 1), (float)marginW, marginH);
		
         
         
         int oldW = marginW;
         int oldWInit = marginW;
         marginW = (int)((double)marginW + Math.abs(rectangle.getCenterX()) * 1.5D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
         System.out.println("第2个字：x="+marginW +" ;y="+marginH);
         g2d.drawString(font.getFontContent().substring(1, 2), (float)marginW, marginH);
         
         
         marginW = (int)((double)marginW + Math.abs(rectangle.getCenterX()) * 1.5D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
         System.out.println("第3个字：x="+marginW +" ;y="+marginH);
         g2d.drawString(font.getFontContent().substring(2, 3), (float)marginW, marginH);
         
         marginW = (int)((double)marginW + Math.abs(rectangle.getCenterX()) * 1.5D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
         System.out.println("第4个字：x="+marginW +" ;y="+marginH);
         g2d.drawString(font.getFontContent().substring(3, 4), (float)marginW, marginH);
         
         //第二行高度
         marginH = (float)((double)marginH + Math.abs(rectangle.getHeight()) * 1.0D);
         
         
         System.out.println("第5个字：x="+oldW +" ;y="+marginH);
         
         String line5 = font.getFontContent().substring(4, 5);
         g2d.drawString(line5, (float)oldW, marginH);
         
         if(!line5.equals(".")) {
        	 oldW = (int)((double)oldW + Math.abs(rectangle.getCenterX()) * 1.5D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
         }else {
        	 oldW = (int)((double)oldW + Math.abs(rectangle.getCenterX()) * 0.4D);
         }
        
         g2d.drawString(font.getFontContent().substring(5, 6), (float)oldW, marginH);
         
         oldW = (int)((double)oldW + Math.abs(rectangle.getCenterX()) * 1.5D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
         g2d.drawString(font.getFontContent().substring(6, 7), (float)oldW, marginH);
         
         oldW = (int)((double)oldW + Math.abs(rectangle.getCenterX()) * 1.5D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
         g2d.drawString(font.getFontContent().substring(7, 8), (float)oldW, marginH);
         
         oldW = (int)((double)oldW + Math.abs(rectangle.getCenterX()) * 1.5D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
         g2d.drawString(font.getFontContent().substring(8, 9), (float)oldW, marginH);
         
         
         //绘制编号
         Font fnew = new Font(font.getFontFamily(), 1, 26);
         g2d.setFont(fnew);
         
         marginH = (float)((double)marginH + Math.abs(rectangle.getHeight()) * 1.0D);
         oldW = (int)((double)oldW + Math.abs(rectangle.getCenterX()) * 2.0D + (font.getFontSpace() == null ? 10.0D : font.getFontSpace()));
         g2d.drawString(font.getNo(), (float)oldWInit, marginH);
         
         
		return nbi;
	}
}
